import java.sql.SQLOutput;

class Student{
    private String name;
    public int age;
    public static String classRoom;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(){
        System.out.println(this.name+"正在吃饭");
    }
    public static void sleep(){
        System.out.println("正在睡觉");//this.name,注意此处不能用this，因为在静态方法内部不能使用非静态数据成员，this不能在静态方法中使用
    }
}
public class Test {
    public static void main(String[] args) {
        Student.classRoom = "202";
        Student.sleep();
        Student student1 = new Student("旺财",28);
        student1.classRoom = "202";
        Student student2 = new Student("来福",21);
        student2.classRoom = "202";
        Student student3 = new Student("狗顺",22);
        student3.classRoom = "202";

    }
    public static void main1(String[] args) {
        Student student = new Student("沸羊羊",20);
        student.age = 10;
        student.setAge(15);
        System.out.println(student.getAge());

    }
}
